What is @babel/plugin-transform-named-capturing-groups-regex?
The @babel/plugin-transform-named-capturing-groups-regex package allows Babel to transform named capturing groups in regular expressions into a format that can be understood by environments that do not support this feature natively. Named capturing groups in regular expressions provide a way to assign names to the various parts of a matched input, making the regex more readable and the matches easier to work with.
Transformation of named capturing groups
This feature allows developers to use named capturing groups in their regular expressions, which are then transformed by Babel for compatibility with environments that do not support this syntax. The code sample shows a regular expression that uses named capturing groups to match a date format.
"const regex = /(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})/;"